﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class BombPickup : MonoBehaviour
{
    Animator animator;
    // Start is called before the first frame update
    void Start()
    { 
        animator = transform.root.GetComponent<Animator>();
    }

    void OnCollisionEnter2D(Collision2D col)
    {
        if (col.gameObject.tag == "Ground")
        {
            animator.SetTrigger("land");
        }
        else if(col.gameObject.tag == "Player")
        {
            col.gameObject.GetComponent<Items>().getBomb();
            Destroy(transform.root.gameObject);
        }
    }
}
